package com.woniu.service.command;

import com.woniu.inlet.web.vo.PayToOrderVo;
import com.woniu.utils.ApplicationContextHolder;
import lombok.Data;

@Data
public class FundOrGoldBuyCommand {
    private PayToOrderVo productBuyFo;
    private FundOrGoldBuyCommandHandler handler;

    public FundOrGoldBuyCommand(){
        this.handler=ApplicationContextHolder.getApplicationContext()
                     .getBean(FundOrGoldBuyCommandHandler.class);
    }

    public FundOrGoldBuyCommand(PayToOrderVo fo){
        this();
        this.productBuyFo=fo;
    }

    public void execute() {
        handler.productBuy(this);
    }


}
